import sys
import nltk

if __name__ == "__main__" :
	print [nltk.chunk.ne_chunk(tagged) for tagged in nltk.batch_pos_tag([nltk.word_tokenize(sent) for sent in nltk.sent_tokenize((" ".join(sys.argv[1:])).lower())])]






fn = lambda u,v: wordnet.wup_similarity(wordnet.synsets(u)[0],wordnet.synsets(v)[0])





def simil(word1,word2):
...   print wordnet.wup_similarity(wordnet.synsets(word1)[0],wordnet.synsets(word2)[0])
... 


def best_similarity(word1,word2):
	res = None
	check_all = []
	for syn1 in wordnet.synsets(word1):
		for syn2 in wordnet.synsets(word2):
			check_all.append((syn1,syn2))
	best = 0
	for (w1,w2) in check_all:
		current = wordnet.wup_similarity(w1,w2)
		if current > best:
			res = (w1,w2)
			best = current
	if res: 
		print res, res[0].lowest_common_hypernyms(res[1]), wordnet.wup_similarity(res[0],res[1]), wordnet.lch_similarity(res[0],res[1])



best_similarity("food","orange")

